package cn.edu.sdjzu.xg.eagle.entity;

import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author tg.si@188.com
 * @project xg23
 * @date 2025/3/26
 */

@ToString
@NoArgsConstructor
public class Department implements Comparable<Department>, Serializable {
    private Integer id;
    private String description;
    private String no;
    private String remarks;
    private School school;
//    {
//        this.id = IdUtil.getId();
//    }
    public Department(Integer id, String description, String no,
                      String remarks, School school) {
        this(description, no, remarks, school);
        this.id = id;
    }

    public Department(String description, String no,
                      String remarks, School school) {
        this(description, no, remarks);
        this.school = school;
    }

    public Department(String description, String no,
                      String remarks) {
        this.description = description;
        this.no = no;
        this.remarks = remarks;
    }

    public Integer getId() {
        return id;
    }

    public String getDescription() {
        return description;
    }

    public String getNo() {
        return no;
    }

    public String getRemarks() {
        return remarks;
    }

    public School getSchool() {
        return school;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public void setSchool(School school) {
        this.school = school;
    }

    /**
     * 编号排序
     * @param o the object to be compared.
     * @return
     */
    @Override
    public int compareTo(Department o) {
        // no为排序依据
        return this.no.compareTo(o.no);
    }
}
